/*
 * @Author: 大朱 243469235@qq.com
 * @Date: 2024-08-13 09:57:44
 * @LastEditors: 大朱 243469235@qq.com
 * @LastEditTime: 2024-08-14 11:05:53
 * @FilePath: \smart-electrical-box-nest\src\app\user\user.controller.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import {
  Get,
  Controller,
  Post,
  Body,
  Query,
  UseGuards,
  Param,
} from '@nestjs/common';
import { SysService } from './sys.service';
import { Roles } from '../../auth/roles.decorator';
import { RolesGuard } from '../../auth/roles.guard';

@Controller('sys')
export class SysController {
  constructor(private readonly sysService: SysService) {}

  /**
   * @description: 修改
   * @param {type}
   */
  @Roles('admin')
  @UseGuards(RolesGuard)
  @Get('get')
  get(): Promise<object> {
    return this.sysService.get();
  }

  /**
   * @description: 修改
   * @param {type}
   */
  @Roles('admin')
  @UseGuards(RolesGuard)
  @Post('/put')
  put(@Body() body: any): Promise<object> {
    return this.sysService.put(body.smsMoney, body.phoneMoney);
  }
}
